package com.bw.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class UserAspect {
    @Pointcut(value = "execution(* com.bw.service.*.*(..))")
    public void pointcut(){

    }

    // 前置通知
    @Before(value = "pointcut()")
    public  void printLogg(JoinPoint point){
        System.out.println("当前系统时间-开始执行");
    }
    //    后置通知
    @After(value = "pointcut()")
    public  void currentTime(JoinPoint point){
        System.out.println("当前系统时间-执行结束");
    }
}
